<div class="users index">
	<h2><?php echo __('Usuários'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('id'); ?></th>
			<th><?php echo $this->Paginator->sort('username'); ?></th>
			<th><?php echo $this->Paginator->sort('nome'); ?></th>
			<th><?php echo $this->Paginator->sort('nome_cracha'); ?></th>
			<th><?php echo $this->Paginator->sort('instituicao'); ?></th>
			<th><?php echo $this->Paginator->sort('cargo'); ?></th>
			<th><?php echo $this->Paginator->sort('telefone'); ?></th>
			<th></th>
			
	</tr>
	<?php
	foreach ($users as $user): ?>
	<tr>
		<td><?php echo h($user['User']['id']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['username']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['nome']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['nome_cracha']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['instituicao']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['cargo']); ?>&nbsp;</td>
		
		<td><?php echo h($user['User']['telefone']); ?>&nbsp;</td>
		<td><?php if($user['User']['estudante'])
					echo $this->Html->image('icons/book.png', array('title'=>'Estudante', 'class'=>'icon'));
				if($user['User']['socio'])
					echo $this->Html->image('icons/socio.png', array('title'=>'Sócio da ABE/RBRAS', 'class'=>'icon'));
				if($user['User']['pago'])
					echo $this->Html->image('icons/paid.png', array('title'=>'Pago', 'class'=>'icon'));
				if($user['User']['aprensenta_trabalho'])
					echo $this->Html->image('icons/presentation.png', array('title'=>'Apresenta trabalho', 'class'=>'icon'));
		?>		
		</td>
		<td class="actions">
			<?php //echo $this->Html->image('icons/view.png', array('class'=>'icon', 'title'=>'+ Info', 'url'=>array('action' => 'view', $user['User']['id']))); ?>
			<?php //echo $this->Html->image('icons/edit.png',array('class'=>'icon', 'title'=>'Editar', 'url'=>array('action' => 'edit', $user['User']['id']))); ?>
			<?php //echo $this->Html->image('icons/pass.png', array('class'=>'icon', 'title'=>'Trocar senha', 'url' => 'trocar_senha/'.$user['User']['id'])); ?>
			<?php echo $this->Html->link('+Info', '/users/view/'.$user['User']['id']);?>
			<?php echo $this->Html->link('Editar', '/users/edit/'.$user['User']['id']);?>
			<?php echo $this->Html->link('Trocar senha', '/users/trocar_senha/'.$user['User']['id']);?>
			<?php echo $this->Html->link('Tornar Revisor', '/users/vira_revisor/'.$user['User']['id']);?>
			<?php echo $this->Form->postLink(__('Apagar'), array('action' => 'delete', $user['User']['id']), null, __('Are you sure you want to delete # %s?', $user['User']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
<?php
	echo $this->Paginator->counter(array(
	'format' => __('Página {:page} de {:pages}, mostrando {:current} usuários de {:count}')
	));
	?>	</p>

	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('Anterior'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('Próximo') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>